package com.xiaotu.pojo;

import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.redis.core.RedisHash;
import org.springframework.data.redis.core.index.Indexed;

import java.util.List;
@Data
@RedisHash("persons")   //指定操作实体类对象在Redis数据库中的存储空间
public class Person {
    @Id                 //标志实体类主键
    private Integer id;
    @Indexed            //标志对应属性在Redis数据库中生成二级索引
    private String firstname;
    @Indexed
    private String lastname;
    private Address address;
    private List<Family> familyList;

    public Person() {
    }

    public Person(String firstname, String lastname) {
        this.firstname=firstname;
        this.lastname=lastname;
    }
}
